<template>
  <el-table
    class="el-table"
    :data="table"
    fit>
    <el-table-column
      prop="bgProject"
      fixed
      label="所属项目">
    </el-table-column>
    <el-table-column
      prop="demandName"
      label="需求名称">
    </el-table-column>
    <el-table-column
      prop="proposer"
      label="提出人">
    </el-table-column>
    <el-table-column
      prop="proposeTime"
      label="提出时间">
    </el-table-column>
    <el-table-column
      label="标签">
      <template slot-scope="scope">
        <el-tag v-if="scope.row.contractAffected == 1">需求增加</el-tag>
        <el-tag v-if="scope.row.contractAffected == 2">需求减少</el-tag>
        <el-tag v-if="scope.row.contractAffected == 3">影响验收</el-tag>
        <el-tag v-if="scope.row.contractAffected == 4">不影响验收</el-tag>
        <el-tag v-if="scope.row.contractAffected == 5">影响合同</el-tag>
        <el-tag v-if="scope.row.contractAffected == 6">不影响合同</el-tag>
        <el-tag v-if="scope.row.contractAffected == 7">已充分沟通</el-tag>
        <el-tag v-if="scope.row.contractAffected == 8">未充分沟通</el-tag>
      </template>
    </el-table-column>
    <el-table-column
      label="结果"
      fixed="right"
      width="200px">
      <template slot-scope="scope">
        <el-button type="primary"
                   @click="showDialog(scope.row)"
                   v-if="scope.row.ifCheck == 0">
          审核
        </el-button>
        <el-tag type="primary"
                v-if="scope.row.ifCheck == 1">
          已通过
        </el-tag>
        <el-tag type="danger"
                v-if="scope.row.ifCheck == 2">
          未通过
        </el-tag>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  name: 'DemandReviewTable',
  data() {
    return {
    }
  },
  props: {
    table: Array
  },
  methods: {
    showDialog(demand) {
      this.$emit("updateDialogVisible", demand)
    },
  }
}
</script>

<style scoped>

</style>
